<style>
    .ulBox>li{ line-height: 35px;}
    .inpStyle{ width: 23% ; height: 39px; border-radius: 5px; border: 1px solid #A9A9A9;padding-left: 15px;}
    .ulStyle>li{ margin-bottom: 20px; line-height: 39px; }
    .ulStyle>li>span{text-align: right ; color: #666666;}
    .btnBox>button{ background: white; border: 1px solid #cccccc }
    .tool_ipt{  border:  none;  outline:  none;  display:  inline-block;  width:  50%;  height:  50%;  background: #F9F9F9; }
    .divBox{ display: flex}
    .divBox>div{ box-shadow: 1px 2px 5px #888888;flex: 1;margin: 0px 5px;}
    .divBox>div>h3{ background:#337ab7;line-height: 40px;color: white; text-indent: 1em ;margin-top: 0;}
    #dropdownMenu1,#dropdownMenu2{ margin: 0;  background: white; color: #666666;}
    .nav-tabs > li > a{ background:white;color: #666666;border: 1px solid #dddddd;}
    .nav-tabs > li.active > a,
    .nav-tabs > li.active > a:hover,
    .nav-tabs > li.active > a:focus {  background: #30add2;  border-bottom:1px solid #30add2;  color: white;  }
</style>
<div id="doctorLookedInfoForm">
    <div style="display: none">
        <input type="hidden" id="customerId" value="${customerId}">
    </div>
    <div>
        <ul class="nav nav-tabs" role="tablist" style="border: none;margin-bottom: 10px;" id="navBoxs">
            <li style="margin-right: 8px;" role="presentation" class="active onRecord"><a href="#follow" aria-controls="follow" role="tab" data-toggle="tab">随访记录</a></li>
            <li role="presentation"><a href="#newfollow" aria-controls="profile" role="tab" data-toggle="tab">新建随访</a></li>
            <li role="presentation" onclick="appointments()"><a href="#appointment" aria-controls="profile" role="tab" data-toggle="tab">复诊预约</a></li>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active onRecord" id="follow">
                <#table id="FollowTableList"/>
            </div>
            <div role="tabpanel" class="tab-pane actived" id="newfollow">
                <div class="divBox">
                    <div>
                        <h3>就诊</h3>
                        <div class="clearfix">
                            <p style="text-indent: 1em">处置</p>
                            @for(item in caseInfoList){
                            <div class="col-sm-12 clearfix" style="border: 1px solid #cccccc;background:#F9F9F9;">
                                <div class="col-sm-3" style="margin-top: 35px;">
                                    <div style="width: 100%;height:50px;display: flex;flex-wrap:wrap;">
                                        <input class="tool_ipt" style="border-right: 1px solid black;border-bottom: 1px solid black;text-align: right;padding-right: 4px" id="leftUp5"  value="${item.leftUp5}" readonly="readonly">
                                        <input class="tool_ipt" style="border-bottom: 1px solid black;padding-left: 4px" id="leftDown5"  value="${item.leftDown5}" readonly="readonly">
                                        <input class="tool_ipt" style="border-right: 1px solid black;text-align: right;padding-right: 4px" id="rightUp5"  value="${item.rightUp5}" readonly="readonly">
                                        <input class="tool_ipt" style="padding-left: 4px" id="rightDown"  value="${item.rightDown5}" readonly="readonly">
                                    </div>
                                </div>
                                <div class="col-sm-9" style="border-left: 1px solid #cccccc;">
                                    <div style="padding: 11px 0 10px;">
                                        <textarea disabled="disabled" rows="6" style="width: 100%">${item.dispose}</textarea>
                                    </div>
                                </div>
                            </div>
                            @}
                        </div>
                        <div>
                            <p style="text-indent: 1em;margin-top: 10px;">医嘱</p>
                            <textarea disabled="disabled" rows="6" style="width: 98%">
                                @for(its in caseInfoList){
                                    ${its.doctorAdvice}
                                @}
                            </textarea>
                        </div>
                    </div>

                    <div>
                        <h3>随访</h3>
                        <ul class="ulStyle clearfix">
                            <li class="col-sm-12">
                                <span class="col-sm-4">随访时间：</span>
                                <input id="revisitTime" class="inpStyle col-sm-8" type="text" onclick="laydate({istiem:true,format:'YYYY-MM-DD'})">
                            </li>
                            <li class="col-sm-12">
                                <span class="col-sm-4">随访医生：</span>
                                <select id="doctor" class="inpStyle col-sm-8" name="doctor" ></select>
                            </li>
                            <li class="col-sm-12">
                                <span class="col-sm-4">创建人：</span>
                                <input class="inpStyle col-sm-8" id="createName" name="inpStyle" disabled="disabled" value="${userName}">
                            </li>
                            <li class="col-sm-12" style="line-height: 40px;">
                                <span class="col-sm-4">内容模板：</span>
                                <div class="btn-group">
                                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        内容模板<span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu2" style="left: 0;">
                                        <li id="currency"><a href="javascript:;">通用随访模板</a></li>
                                        <li id="scaling"><a href="javascript:;">洁牙</a></li>
                                        <li id="threeFollow"><a href="javascript:;">三个月随访</a></li>
                                        <li id="yearFollow"><a href="javascript:;">一年后随访</a></li>
                                    </ul>
                                </div>
                            </li>
                            <li class="col-sm-12">
                                <span class="col-sm-4">随访内容：</span>
                                <textarea id="remarks2" class="col-sm-8" name="remarks2" style="height: 100px;width: 60%"> </textarea>
                            </li>
                            <li class="col-sm-12" style="line-height: 40px;">
                                <span class="col-sm-4">结果模板：</span>
                                <div class="btn-group">
                                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        结果模板<span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu" aria-labelledby="dropdownMenu1" style="left: 0;">
                                        <li><a href="javascript:;" id="followResults">洁牙正常</a></li>
                                    </ul>
                                </div>
                            </li>
                            <li class="col-sm-12">
                                <span class="col-sm-4">随访结果：</span>
                                <textarea id="revisitContent" class="col-sm-8" name="revisitContent" style="height: 100px;width: 60%"> </textarea>
                            </li>
                            <li class="col-sm-12">
                                <div class="col-sm-4"></div>
                                <div class="col-sm-8" style="padding: 0;">
                                    <div class="btnBox">
                                        <button class="btn" type="button" id="submit">保存</button>
                                        <button class="btn" type="button" id="cancel" onclick="DoctorLookedInfoDlg.close()">取消</button>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctxPath}/static/modular/doctorLooked/doctorLooked_info.js"></script>
<script src="${ctxPath}/static/modular/doctorLooked/follow_list.js"></script>
<script>
    submit.onclick = function() {
        var doctor= document.getElementById("doctor").value;   //医生
        var createName= document.getElementById("createName").value;  //创建人
        var remarks= document.getElementById("remarks2").value;   //随访内容
        var revisitContent= document.getElementById("revisitContent").value;   //随访结果
        var reservationsId= document.getElementById("reservationsId").value;   //预约id
        var customerId= document.getElementById("customerId").value;   //客户id
        var revisitTime= document.getElementById("revisitTime").value;   //随访时间
        var arrivalStore= document.getElementById("arrivalStore").value;   //门诊
        if(doctor==null||doctor==""){
            alert("请选择医生!");
        }else{
            $.ajax({
                url: "${ctxPath}/doctorLooked/addDoctorContent2",
                type: "post",
                data: {
                    doctor: doctor,
                    revisitTime: revisitTime,
                    createName:createName,
                    remarks: remarks,
                    revisitContent:revisitContent,
                    arrivalStore:arrivalStore,
                    customerId:customerId,
                    reservationsId: reservationsId
                },
                success: function (data) {
                    alert('操作成功!');
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);
                },
                error: function (data) {
                    alert('内部故障!');
                }
            });
        }
    }

</script>